package se.hrbustrc.hlgshopping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RestController;
import se.hrbustrc.hlgshopping.entity.User;


@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from tb_user where fUserCode = #{username} and fUserPassword = #{password} limit 1")
    @Result(column = "fUserId", property = "userId",id = true)
    @Result(column = "fUserCode", property = "userCode")
    @Result(column = "fUserPass", property = "userPass")
    @Result(column = "fUserName", property = "userName")
    @Result(column = "fUserRole", property = "userRole")
    @Result(column = "fUserPhone", property = "userPhone")
    @Result(column = "fUserEmail", property = "userEmail")

    User findByUsername(String username);


}
